home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
managr09
/
autoxc40.bas
< prev
next >
Wrap
BASIC Source File
|
1992-01-25
|
5KB
|
255 lines
chngauto:
cls
print "View or Change Your AUTOEXEC.BAT file."
print
print
print "On which drive is your AUTOEXEC.BAT"
input "file";drive$
redrivea:
drive$=drive$+"\"
if drive$="a:\" then file1$="a:\autoexec.bat"
if drive$="A:\" then file1$="a:\autoexec.bat"
if drive$="b:\" then file1$="b:\autoexec.bat"
if drive$="B:\" then file1$="b:\autoexec.bat"
if drive$="c:\" then file1$="c:\autoexec.bat"
if drive$="C:\" then file1$="c:\autoexec.bat"
if drive$="d:\" then file1$="d:\autoexec.bat"
if drive$="D:\" then file1$="d:\autoexec.bat"
if drive$="e:\" then file1$="e:\autoexec.bat"
if drive$="E:\" then file1$="e:\autoexec.bat"
if drive$="a:\" then file2$="a:\autoexec.bak"
if drive$="A:\" then file2$="a:\autoexec.bak"
if drive$="b:\" then file2$="b:\autoexec.bak"
if drive$="B:\" then file2$="b:\autoexec.bak"
if drive$="c:\" then file2$="c:\autoexec.bak"
if drive$="C:\" then file2$="c:\autoexec.bak"
if drive$="d:\" then file2$="d:\autoexec.bak"
if drive$="D:\" then file2$="d:\autoexec.bak"
if drive$="e:\" then file2$="e:\autoexec.bak"
if drive$="E:\" then file2$="e:\autoexec.bak"
automenu:
cls
print "You have the following options:"
print
print
print "1- Just view the AUTOEXEC.BAT file."
print
print "2- Add lines to the end of your file."
print
print "3- Create a new AUTOEXEC.BAT file."
print
print "4- Return to the Main Options Menu."
print
print
print "Please press the number corresponding"
input "to your choice, and then press Enter. ",chngauto$
if chngauto$="1" then
cls
gosub autolook
goto automenu
elseif chngauto$="2" then
cls
gosub appndaut
gosub autolook
goto automenu
elseif chngauto$="3" then
cls
goto newauto
elseif chngauto$="4" then
cls
goto finish
else
goto automenu
end if
'This routine creates a new AUTOEXEC.BAT file.
newauto:
cls
open file1$ for input as 1
open file2$ for output as 2
while not eof(1)
line input # 1, a$
print # 2, a$
wend
close # 1
close # 2
kill file1$
cls
print "Your AUTOEXEC.BAT file has been"
print "changed to AUTOEXEC.BAK in order to"
print "save it for later use. To use it"
print "later, you will have to rename it"
print "AUTOEXEC.BAT after renaming your new"
print "AUTOEXEC.BAT to something else (for"
print "example, AUTOEXEC.X)."
print
print
print "Press any key to continue. ";
gosub presskey
scndchng:
cls
open file1$ for output as 1
print "Please type the first line you want,"
print "then press Enter (Q to quit).
print
input "> ",firstln$
if firstln$="q" then
goto nochange
elseif firstln$="Q" then
goto nochange
end if
print # 1, firstln$
contline:
print
print "Please type your next line, followed"
print "followed by Enter (Q to quit)."
print
input "> ",nextline$
if nextline$="q" then
goto stopchng
elseif nextline$="Q" then
goto stopchng
end if
print # 1, nextline$
goto contline
stopchng:
close # 1
cls
gosub autolook
print
print
print
print "If this is not O.K. AND you want to"
print "change it, press C and then Enter."
print
print "To restore your original AUTOEXEC.BAT,"
print "press R and then Enter."
print
print "If you're happy with it as is, type OK"
input "and Enter. ",changeyn$
rechange:
if changeyn$="c" then
goto scndchng
elseif changeyn$="C" then
goto scndchng
elseif changeyn$="r" then
goto nochange
elseif changeyn$="R" then
goto nochange
elseif changeyn$="ok" then
goto automenu
elseif changeyn$="OK" then
goto automenu
elseif changeyn$="oK" then
goto automenu
elseif changeyn$="Ok" then
goto automenu
end if
print
input "You must choose C, R, or OK. ",changeyn$
goto rechange
nochange:
cls
reset
kill file1$
open file2$ for input as 1
open file1$ for output as 2
while not eof(1)
line input # 1, a$
print # 2, a$
wend
reset
print "Your original AUTOEXEC.BAT file has"
print "been restored."
print
print
print "Press any key to continue. ";
gosub presskey
goto automenu
'This is the end of the routine for working with the AUTOEXEC.BAT file in 40c.
'Here is the routine for looking at the AUTOEXEC.BAT file in 40-column mode.
autolook:
cls
reset
print "Here is your file:"
print
print
open file1$ for input as 1
while not eof(1)
line input # 1, a$
print a$
wend
close # 1
print
print
print "Press any key to continue. ";
gosub presskey
return
'This is the end of the routine for looking at the AUTOEXEC.BAT file in 40cols
'Here is the routine for adding lines to the end of AUTOEXEC.BAT.
appndaut:
cls
reset
open file1$ for append as 1
appndagn:
print
print "Line to add (Q to quit)?"
print
input "> ",appendln$
if appendln$="q" then
close # 1
return
elseif appendln$="Q" then
close # 1
return
end if
print # 1, appendln$
goto appndagn
'This is the end of the routine for adding to the end of AUTOEXEC.BAT in 40col
'Here is the routine for continuing when the user presses a key.
presskey:
wait:
a$=inkey$
if a$="" then goto wait
return
'This is the end of the routine for continuing when the user presses a key.
'Here is the routine for ending the program.
finish:
end